#include "junix.h"
#include <regex.h>

int main(int argc, char **argv)
{

	char *re="(^hello)|(good$)";
	regex_t pattern;
	int ret = regcomp(&pattern, re, REG_EXTENDED|REG_NEWLINE);
	if(ret)
		err_sys("regcomp");

	regmatch_t *match = calloc( pattern.re_nsub,
			sizeof(regmatch_t));

	char *text="hello junix.";
	ret = regexec(&pattern, 
			text,
			pattern.re_nsub, 
			match, 
			0);

	if(!ret)
		printf("match\n");

	return 0;
}

